#include "parser.h"
#include <iostream>


Parser::Parser(QString p_filename)
{
 filename = p_filename;
}

bool Parser::startDocument()
{
    qDebug("Start Document");
    return true;
}

bool Parser::startElement( const QString&, const QString&, const QString& qName, const QXmlAttributes& att )
{
    //found element qname

    qDebug(qName.toStdString().c_str());
    return true;
}

QDomNodeList Parser::elementsByTagName(const QString &tag)
{
    QDomDocument doc( "myDocument" );
    QFile qf(filename);
    doc.setContent( &qf );
    QDomElement docElement = doc.documentElement();
    return docElement.elementsByTagName(tag);
}


